import request from '@/utils/request'

export function login(data) {
  return request({
    url: '/admin/login',
    method: 'post',
    data
  })
}
export function logout(data) {
  return request({
    url: '/admin/logout',
    method: 'post',
    data
  })
}
export function upload(data) {
  return request({
    url: '/admin/upload',
    method: 'post',
    data
  })
}
export function admin_edit(data) {
  return request({
    url: '/admin/admin_edit',
    method: 'post',
    data
  })
}

export function person(data) {
  return request({
    url: `/admin/person?id=${data.id}`,
    method: 'get'
  })
}
export function personList() {
  return request({
    url: `/admin/admin_list`,
    method: 'get'
  })
}

export function getInfo(token) {
  return request({
    url: '/vue-admin-template/user/info',
    method: 'get',
    params: { token }
  })
}

export function menu(data) {
  return request({
    url: '/admin/menu',
    method: 'get',
    data
  })
}
export function permission(data) {
  return request({
    url: `/admin/other_admin_permission?admin_id=${data}`,
    method: 'get'
  })
}
export function setPermission(data) {
  return request({
    url: '/admin/set_permission',
    method: 'post',
    data
  })
}
export function excel(data) {
  return request({
    url: '/admin/download_excel',
    method: 'post',
    data
  })
}
